package com.sise.foodplatform.service.impl;

import com.sise.foodplatform.dao.RestaurantMapper;
import com.sise.foodplatform.pojo.Restaurant;
import com.sise.foodplatform.service.RestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: tae
 * @Date: 2021/4/12 21:21
 * @Description:
 */

@Service
public class RestaurantServiceImpl implements RestaurantService {

    @Autowired
    private RestaurantMapper restaurantMapper;

    @Override
    public List<Restaurant> getAllRestaurant(String resName, int PageStart, int pageSize) {
        return restaurantMapper.getAllRestaurant(resName, PageStart, pageSize);
    }

    @Override
    public int getRestaurantCounts(String resName) {
        return restaurantMapper.getRestaurantCounts(resName);
    }

    @Override
    public List<Restaurant> getAllRestaurantByUserId(String resName, int PageStart, int pageSize, int userId) {
        return restaurantMapper.getAllRestaurantByUserId(resName, PageStart, pageSize, userId);
    }

    @Override
    public int getRestaurantCountsByUserId(String resName, int userId) {
        return restaurantMapper.getRestaurantCountsByUserId(resName,userId);
    }

    @Override
    public int updateRestaurantState(Integer res_id, Boolean state) {
        return restaurantMapper.updateRestaurantState(res_id, state);
    }

    @Override
    public int addRestaurantByUser(Restaurant restaurant) {
        return restaurantMapper.addRestaurantByUser(restaurant);
    }

    @Override
    public int editRestaurantById(Restaurant restaurant) {
        return restaurantMapper.editRestaurantById(restaurant);
    }

    @Override
    public int deleteRestaurantById(int id) {
        return restaurantMapper.deleteRestaurantById(id);
    }

    @Override
    public Restaurant getUpdateRestaurant(int id) {
        return restaurantMapper.getUpdateRestaurant(id);
    }

    @Override
    public List<Restaurant> getAllRestaurantByLike() {
        return restaurantMapper.getAllRestaurantByLike();
    }
}
